package org.itboys.core.service.mongo.web;


import org.itboys.admin.service.lasted.SundayUploadService;
import org.itboys.core.common.SundayCommonConstants;
import org.itboys.core.entity.mongo.SundayMember;
import org.itboys.mongodb.core.MongoDataSource;
import org.itboys.mongodb.service.BaseMongoService;
import org.itboys.param.PageResult;
import org.itboys.param.ParamUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.Map;

/**
 * 作者：jiangxiong
 * 日期：2017年5月8日
 * 联系方式 ：empty90911@126.com
 * 描述：圣代_用户_service
 */
@Service
public class SundayMemberService extends BaseMongoService<SundayMember> {
    @Autowired
    private SundayUploadService uploadService;
    @Resource(name = "mobileDs")
    private MongoDataSource mobileDataSource;
    @Override
    protected MongoDataSource getMongoDataSource() {
        return mobileDataSource;
    }
    @Override
    protected Class<SundayMember> getEntityClass() {
        return SundayMember.class;
    }
    /**
     * 分页获取用户信息
     * @param request
     * @return
     */
    public PageResult<SundayMember> selectMember(HttpServletRequest request){
        Map<String,Object> param =ParamUtil.packageMongoExactParam(request,"userType","status");
        param.put("isDeleted", 0);
        Map<String,String> containsparam = ParamUtil.packageMongoVagueParam(request,"nickName","mobile");
        PageResult<SundayMember> pageResult=super.containpageQuery(request,containsparam,param);
        return pageResult;
    }


}
